package com.yyk.yykywd.mvvm

import android.util.Log
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

/**
 * 文件描述：
 * Created by guo on 2019-11-15.
 */
class DemoViewModel : ViewModel() {
    var count = MutableLiveData<String>()

    fun countPlus() {
        Log.i(TAG,"改变count值")
        count.value = "www${count.value}"
    }

    companion object{
        const val TAG = "DemoViewModel"
    }

    init {
        Log.i(TAG, "DemoViewModel created!")
        count.value = "hahahah"
    }

    override fun onCleared() {
        super.onCleared()
        Log.i(TAG, "DemoViewModel destroyed!")
    }
}